package com.ayoka.parenting.ui.live.discussgroup;

import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;

import com.ayoka.parenting.bean.BaseResponse;
import com.ayoka.parenting.bean.BasicUserInfoBean;
import com.ayoka.parenting.bean.DiscussGroupBean;
import com.ayoka.parenting.bean.DiscussGroupTempRoomBean;
import com.ayoka.parenting.interf.RequestCallback;
import com.ayoka.parenting.mvp.BasePresenter;
import com.ayoka.parenting.mvp.BaseView;
import com.tencent.imsdk.TIMMessage;

import java.util.List;

/**
 * @ProjectName: MVPPlugin.
 * @ClassName: DiscussGroupContract.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/10/10 18:17.
 */
public class DiscussGroupContract {

    interface View extends BaseView {
        void configDiscussGroupDetailData(DiscussGroupTempRoomBean data);

        void onJoinDiscussGroupCallback(boolean isSuccess);

        void onQuitDiscussGroupCallback(boolean isSuccess);

        void oUpdateMemberSpeakingStatusCallback(boolean isSuccess);

        void configOnlineMemberList(List<BasicUserInfoBean> memberList);

        void checkHasMemberIsSpeakingCallback(Integer data);

        void onDialogDismiss(DialogFragment dialog);
    }

    interface Presenter extends BasePresenter<View> {
        void getDiscussGroupDetailData(int roomId, String scheduleId);

        void joinDiscussGroup(int roomId);

        void quitDiscussGroup();

        BasicUserInfoBean getMemberByUserId(String userId);

        void UpdateMemberSpeakingStatus(int roomId, String userId, boolean enable);

        void setMemberSpeakingStatus(String userId, boolean enable);

        void saveChatMessage(String userId, boolean isChatToSelf, String content, String operation, TIMMessage message);

        void checkOnlineMemberStatus(int subRoomID);

        void showChatMessageDialog(FragmentManager fragmentManager);

        void sendGroupTextMessage(String message);

        void sendTextMessage(String userId, final String message);
    }

    interface Model {
        void getDiscussGroupDetailData(BasePresenter presenter, int roomId, String scheduleId, RequestCallback<DiscussGroupTempRoomBean> callback);

        void updateMemberUnSpeaking(BasePresenter presenter, int roomId, String userId, RequestCallback callback);

        void updateMemberIsSpeaking(BasePresenter presenter, int roomId, String userId, RequestCallback callback);

        void checkHasMemberIsSpeaking(BasePresenter presenter, int subRoomID, RequestCallback<Integer> requestCallback);
    }
}
